package com.ts.main.admin.controller;
import com.ts.main.admin.dto.MiniUserAddressDto;
import com.ts.main.admin.dto.MiniUserAddressSearchPageDto;
import com.ts.main.admin.exception.R;
import com.ts.main.admin.exception.RPage;
import com.ts.main.admin.service.UserAddressServiceImpl;
import com.ts.main.admin.vo.MiniUserAddressVo;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.media.Schema;
import io.swagger.v3.oas.annotations.tags.Tag;
import jakarta.annotation.Resource;
import lombok.AllArgsConstructor;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * @Author:lk
 * @Date: 2025/6/11  23:25
 */
@AllArgsConstructor
@RestController
@RequestMapping("/miniUserAddress")
@Tag(name = "小程序管理-用户地址管理")
public class MiniUserAddressController {

    private final UserAddressServiceImpl userAddressService;

    @PostMapping("/getMiniUserAddressList")
    @Operation(summary = "查询用户地址列表")
    public RPage<List<MiniUserAddressVo>> getMiniUserAddressPage(@RequestBody MiniUserAddressSearchPageDto dto) {
        return userAddressService.getMiniUserAddressPage(dto);
    }

    @GetMapping("/getMiniUserAddressDetails")
    @Operation(summary = "查询用户地址详情")
    public R<MiniUserAddressVo> getMiniUserAddressDetails(@Schema(description = "小程序用户地址ID") @RequestParam Integer UserAddressId) {
        return R.ok(userAddressService.getMiniUserAddressDetails(UserAddressId));
    }

//    @PostMapping("/saveMiniUserAddress")
//    @Operation(summary = "添加用户地址")
//    public R<MiniUserAddressDto> saveMiniUserAddress(@RequestBody MiniUserAddressDto dto) {
//        return R.ok(userAddressService.saveMiniUserAddress(dto));
//    }
//
//    @PutMapping("/updateMiniUserAddress")
//    @Operation(summary = "修改用户地址")
//    public R<Boolean> updateMiniUserAddress(@RequestBody MiniUserAddressDto dto) {
//        return R.ok(userAddressService.updateMiniUserAddress(dto));
//    }
//
//    @DeleteMapping("/deleteMiniUserAddress")
//    @Operation(summary = "删除用户地址")
//    public R<Boolean> deleteMiniUserAddress(@Schema(description = "小程序用户地址ID") @RequestParam Integer UserAddressId) {
//        return R.ok(userAddressService.deleteMiniUserAddress(UserAddressId));
//    }

}